class_name ConditionStateTransition
extends GameplayStateTransition

##
var target_state_name: String

##
var condition_func: Callable

##
var on_transit_func: Callable


func _init(init_target_state_name: String, init_condition_func: Callable, init_on_transit_func: Callable) -> void:
	target_state_name = init_target_state_name
	condition_func = init_condition_func
	on_transit_func = init_on_transit_func


func _try_condition() -> bool:
	return condition_func.call()


func _try_transition() -> String:
	return target_state_name


func _on_transit() -> void:
	on_transit_func.call()
